﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.IO;
using System.Data;
using System.Xml;
using System.Threading.Tasks;

namespace ProXMLParser
{
    internal interface IXMLParser
    {
        DataSet ConvertXMLToDataSet(string XML);
        DataSet ConvertXMLToDataSet(string XML, bool AppendXMLHeader);
        string ConvertDataSetToXML(System.Data.DataSet ds);
        string ParseXMLFromString(string XML, string XPath);
        string ParseXMLFromString(string XML, string XPath, string Attribute);
        string ParseXMLFromFile(string AbsoluteFilePath, string XPath);
        string ParseFastXMLFromFile(string AbsoluteFilePath, string XPath);
        bool IsWellFormedXML(string XML, out System.Exception NotWellFormedException);
        string LoadXMLAsString(string XML_AbsoluteFilePath);
        bool WriteXMLToFile(string XML, string AbsoluteFilePath);
        bool WriteDataSetAsXMLToFile(DataSet ds, string AbsoluteFilePath);
        string GetNodeOuterXMLFromString(string XML, string XPath);
        string GetNodeInnerXMLFromString(string XML, string XPath);
        XmlNodeList GetNodesFromXMLString(string XML, string XPath);
        ArrayList ParseAllXMLFromString(string XML, string XPath);
        ArrayList ParseAllXMLFromFile(string AbsoluteFilePath, string XPath);
    }

    internal interface IXMLParserAsync
    {
        Task<string> ParseXMLFromFileAsync(string AbsoluteFilePath, string XPath);
        Task<string> LoadXMLAsStringAsync(string XML_AbsoluteFilePath);
        Task<bool> WriteXMLToFileAsync(string XML, string AbsoluteFilePath);
        Task<bool> WriteDataSetAsXMLToFileAsync(DataSet ds, string AbsoluteFilePath);
    }
}
